
#ifndef CHESS_BOARD_H
#define CHESS_BOARD_H

#include <string>
#include <stdio.h>
#include <vector>
#include "BoardPosition.h"
#include "Square.h"

/**
 * The BoardPosition class
 */
class Board {

   public: //methods
      //! Constructor
      //! @param filename the file to be read in for saved game, NULL if new game
      Board (std::string filename = "");

      //! Saves the current state of the board (and pieces) to the ostream
      //! @param os the ostream to be saved to
      //! @returns the ostream passed in
      std::ostream & SaveBoard (std::ostream & os);

      //! @returns the piece at the given BoardPosition, NULL if no piece there
      Piece * GetPiece(BoardPosition pos);

      bool AddPiece(BoardPosition pos, Piece * curPiece);

      Piece * RemovePiece(BoardPosition pos);

   private:
      static const int BOARD_LENGTH = 8;
      void Initialize(); //! Sets the board for a new game;
      void LoadBoard(std::string filename); //! Loads a game from the provided filename
      //! Tracks the pieces using the BP int value, x, 1st , row; y, 2nd, col; starts in top left
      Square pieceTracker[BOARD_LENGTH][BOARD_LENGTH];
};


#endif
